window.onload=getLocation;


function getLocation()
{	
	if(navigator.geolocation)
	{
		navigator.geolocation.getCurrentPosition(showMap);	
	}
}

var map;

function showMap(position)
{
	var googleLatAndLong = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
	
	var mapOptions = {
	zoom: 10, 
	center: googleLatAndLong, 
	mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	
	var mapDiv = document.getElementById("map");
	map = new google.maps.Map(mapDiv, mapOptions);	
}